<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="{$contextPath}/pas/easyui/themes/{$page_theme | default: 'default'}/easyui.css">
    <link rel="stylesheet" type="text/css" href="{$contextPath}/pas/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="{$contextPath}/pas/style/my.css">
    <script type="text/javascript" src="{$contextPath}/pas/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="{$contextPath}/pas/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="{$contextPath}/pas/javascript/my.js"></script>
    
</head> 
<body onpageshow="resetPagination('dg')" style="padding:0px;width:98%">
    {datagrid id="dg" template="/common/datagrid2.tpl" datasource="/invest/StrategyPriceChangeService/findPriceChangeInfo.do?rows=1000&strategy_id=`$Request.strategy_id`"  view="i_price_change_detail"}
    
    <script>
    field_formatters.max_price=function (value, row, index){
      if(value) {
        return parseInt(value * 10000) / 10000;
      }
    }

    field_formatters.min_price=function (value, row, index){
      if(value) {
        return parseInt(value * 10000) / 10000;
      }
    }

    field_formatters.rise_rate=function (value, row, index){
      if(value){
        return parseInt(value * 10000) / 100+"%";
      }
    }

    field_formatters.fell_rate=function (value, row, index){
      if(value){
        return parseInt(value * 10000) / 100+"%";
      }
    }

    field_formatters.remarks=function (value, row, index){
      if(row['max_price']){
        if(row['price'] > row['max_price']) {
          var rise_rate = (row['price'] - row['price_benchmark']) / row['price_benchmark'];
          rise_rate = parseInt(rise_rate * 10000) / 100;
          return '设定基准价格['+row['price_benchmark']+']，最高涨幅['+(parseInt(row['rise_rate'] * 10000) / 100)+"%"+']，当前价格['+row['price']+']，涨幅['+rise_rate+'%]，涨幅超过监控最高幅度';
        }
      }
      if(row['min_price']){
        if(row['price'] < row['min_price']) {
          var fell_rate = (row['price_benchmark'] - row['price']) / row['price_benchmark'];
          fell_rate = parseInt(fell_rate * 10000) / 100;
          return '设定基准价格['+row['price_benchmark']+']，最高跌幅['+(parseInt(row['fell_rate'] * 10000) / 100)+"%"+']，当前价格['+row['price']+']，跌幅['+fell_rate+'%]，跌幅超过监控最高幅度';
        }
      }
      return '无';
    }
    </script>
</body>
</html>